package com.jixi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jixi.mapper.ClassesMapper;
import com.jixi.pojo.entity.Classes;
import com.jixi.service.ClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ClassesServiceImpl extends ServiceImpl<ClassesMapper, Classes> implements ClassesService {
    
    @Autowired
    private ClassesMapper classesMapper;
    
    /**
     * 统计班级数量
     *
     * @return 班级数量
     */
    @Override
    public Long countClasses() {
        LambdaQueryWrapper<Classes> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Classes::getIsDeleted, 0);
        return classesMapper.selectCount(queryWrapper);
    }
}
